<div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="ntModalLabel">{:lang("specify_product_category")}</h4>
            </div>
            <div class="modal-body">
            <div class="row clearfix">
                    <div class="col-md-12 column">
                        <div class="alert alert-dismissable alert-info">
                        <button type="button" class="close">×</button>
                        <p></p>
                        </div>
                    </div>
                    </div>
                <div class="row">
                    <div class="col-md-5">
                        <table class="table table-striped table-hover ntTable" style="padding-top:0">
                            <tbody>
                                <tr>
                                    <td>{:lang("attribute_name")}</td>
                                    <td>{$selfdata.name_zh|default=''}</td>
                                </tr>
                                <tr>
                                    <td>{:lang('product_category_name')}</td>
                                    <td>
                                      {if isset($selfdata.catename.zh)}
                                          {foreach $selfdata.catename.zh as $kn=>$vn}
                                              {$vn}/
                                          {/foreach}
                                      {/if}
                                    </td>
                                </tr>
                                <tr>
                                    <td>{:lang('status')}</td>
                                    <td>{$selfdata.status_name|default=''}</td>
                                    
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="col-md-7">
                        <div class="cat_panel">
                            
                                <table>
                                    <thead>
                                        <tr>
                                            <td colspan="2">{:lang('product_category_name')}</td>
                                        </tr>
                                    </thead>
                                </table>
                                <div style="max-height: 400px;overflow: auto;">
                                    <table>
                                        <tbody class="procate_panel">
                                            {volist name="cateAll" id="vo"}
                                            <tr>
                                                {notempty name='$selfcate_array'}
                                                    {if (in_array($vo.id,$selfcate_array))}
                                                        <td><input type="checkbox" value="{$vo.id}" checked></td>
                                                    {else /}
                                                        <td><input type="checkbox" value="{$vo.id}"></td>
                                                    {/if}
                                                {else /}
                                                    <td><input type="checkbox" value="{$vo.id}"></td>
                                                {/notempty}
                                                <td>{$vo.level|default=0|str_repeat='&emsp;',###*2}{$vo.name_zh}</td>
                                            </tr>
                                            {/volist}
                                        </tbody>
                                    </table>
                                </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>{:lang('cancel')}</button>
                <button type="button" class="btn btn-primary svae" style="padding-left:24px;padding-right:24px"><span class="glyphicon glyphicon-floppy-disk"></span>{:lang('save')}</button>
            </div>
            <input type="hidden" class="valdid" value="{$selfdata.id}">
<script>
    
    $('.svae').click(function(){
        var id=$('.valdid').val()
        var procat_id=[]
        $('.procate_panel input').each(function(){
            if($(this).prop('checked'))
            procat_id.push($(this).val())
        })
        console.log(procat_id)
        $.ajax({
            url:'/admin/proattr/attrBindType?request=bind',
            type:'post',
            data:{
                id,
                procat_id
            },
            success:function(data){
                data = JSON.parse(data)
                if(data.status==1){
                    //toastr.info(data.msg)
                    change_mes_type('.alert',data.status)
                    $('.alert').show()
                    $('.alert p').html('*'+data.msg+'<br>')
                    $('#proatt2catModal').modal('hide')
                }else{
                    change_mes_type('.modal-body .alert',data.status)
                    $('.modal-body .alert').show()
                    $('.modal-body .alert p').html('*'+data.msg+'<br>')
                    //toastr.warning(data.msg);
                }
            }
        })
    })
    $(document).keydown(function (event) {
        if (event.keyCode == 13) {
            $('.svae').click()
        }
        });
</script>